CREATE EXTERNAL TABLE jms_ods.yl_oms_interceptorpiece(
  `id` bigint COMMENT '主键',
  `list_id` string COMMENT '清单编号',
  `package_number` string COMMENT '包号',
  `data_collection_time` timestamp COMMENT '数据获取时间',
  `scan_time` timestamp COMMENT '扫描时间',
  `scan_pda` string COMMENT '扫描PDA编号',
  `status` bigint COMMENT '拦截状态:1待拦截, 2已拦截, 3已撤销',
  `waybill_no` string COMMENT '运单编号',
  `source` bigint COMMENT '来源:1.电商API, 2.呼叫中心',
  `type` bigint COMMENT '类型编号',
  `type_name` string COMMENT '类型：1.取消订单，2.错分件，3.问题件',
  `registration_network_id` bigint COMMENT '登记网点id',
  `registration_network_name` string COMMENT '登记网点名称',
  `registration_network_code` string COMMENT '登记网点编码',
  `registrant_id` bigint COMMENT '登记人ID',
  `registrant_name` string COMMENT '登记人名称',
  `registrant_code` string COMMENT '登记人编码',
  `registration_time` timestamp COMMENT '登记时间',
  `intercept_network_id` bigint COMMENT '拦截网点id',
  `intercept_network_name` string COMMENT '拦截网点名称',
  `intercept_network_code` string COMMENT '拦截网点编码',
  `intercept_id` bigint COMMENT '拦截人ID',
  `intercept_name` string COMMENT '拦截人名称',
  `intercept_code` string COMMENT '拦截人编码',
  `intercept_time` timestamp COMMENT '拦截时间',
  `intercept_num` bigint COMMENT '拦截次数',
  `cancal_network_id` bigint COMMENT '撤销网点id',
  `cancal_network_name` string COMMENT '撤销网点名称',
  `cancal_network_code` string COMMENT '撤销网点编码',
  `cancal_id` bigint COMMENT '撤销人ID',
  `cancal_name` string COMMENT '撤销人名称',
  `cancal_code` string COMMENT '撤销人编码',
  `cancal_time` timestamp COMMENT '撤销时间',
  `registration_remark` string COMMENT '登记备注',
  `cancal_remark` string COMMENT '撤销备注',
  `scan_type_code` bigint COMMENT '扫描类型code',
  `scan_type_name` string COMMENT '扫描类型名称',
  `scan_network_id` bigint COMMENT '扫描网点id',
  `scan_network_name` string COMMENT '扫描网点名称',
  `scan_network_code` string COMMENT '扫描网点CODE')
COMMENT '拦截件登记表'
PARTITIONED BY (
  `dt` string COMMENT '更新/创建日期 (yyyy-MM-dd)')
STORED AS parquet
LOCATION
  '/dw/hive/jms_ods.db/external/yl_oms_interceptorpiece' ;
alter table jms_ods.yl_oms_interceptorpiece add columns(`update_time` timestamp COMMENT '更新时间') cascade;



CREATE EXTERNAL TABLE jms_ods.yl_oms_interceptorpiece_di(
  `id` bigint COMMENT '主键',
  `list_id` string COMMENT '清单编号',
  `package_number` string COMMENT '包号',
  `data_collection_time` timestamp COMMENT '数据获取时间',
  `scan_time` timestamp COMMENT '扫描时间',
  `scan_pda` string COMMENT '扫描PDA编号',
  `status` bigint COMMENT '拦截状态:1待拦截, 2已拦截, 3已撤销',
  `waybill_no` string COMMENT '运单编号',
  `source` bigint COMMENT '来源:1.电商API, 2.呼叫中心',
  `type` bigint COMMENT '类型编号',
  `type_name` string COMMENT '类型：1.取消订单，2.错分件，3.问题件',
  `registration_network_id` bigint COMMENT '登记网点id',
  `registration_network_name` string COMMENT '登记网点名称',
  `registration_network_code` string COMMENT '登记网点编码',
  `registrant_id` bigint COMMENT '登记人ID',
  `registrant_name` string COMMENT '登记人名称',
  `registrant_code` string COMMENT '登记人编码',
  `registration_time` timestamp COMMENT '登记时间',
  `intercept_network_id` bigint COMMENT '拦截网点id',
  `intercept_network_name` string COMMENT '拦截网点名称',
  `intercept_network_code` string COMMENT '拦截网点编码',
  `intercept_id` bigint COMMENT '拦截人ID',
  `intercept_name` string COMMENT '拦截人名称',
  `intercept_code` string COMMENT '拦截人编码',
  `intercept_time` timestamp COMMENT '拦截时间',
  `intercept_num` bigint COMMENT '拦截次数',
  `cancal_network_id` bigint COMMENT '撤销网点id',
  `cancal_network_name` string COMMENT '撤销网点名称',
  `cancal_network_code` string COMMENT '撤销网点编码',
  `cancal_id` bigint COMMENT '撤销人ID',
  `cancal_name` string COMMENT '撤销人名称',
  `cancal_code` string COMMENT '撤销人编码',
  `cancal_time` timestamp COMMENT '撤销时间',
  `registration_remark` string COMMENT '登记备注',
  `cancal_remark` string COMMENT '撤销备注',
  `scan_type_code` bigint COMMENT '扫描类型code',
  `scan_type_name` string COMMENT '扫描类型名称',
  `scan_network_id` bigint COMMENT '扫描网点id',
  `scan_network_name` string COMMENT '扫描网点名称',
  `scan_network_code` string COMMENT '扫描网点CODE',
  `update_time` timestamp COMMENT '更新时间')
COMMENT '拦截件登记表'
PARTITIONED BY (
  `dt` string COMMENT '更新/创建日期 (yyyy-MM-dd)')
STORED AS parquet
LOCATION
  '/dw/hive/jms_ods.db/external/yl_oms_interceptorpiece_di'